"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const base_1 = require("./base");
const map = '日一二三四五六日'.split('');
const numberToHans = (number) => map[number];
exports.numberToWeekHans = number => `周${numberToHans(number)}`;
class WeekPartDescriber extends base_1.Describer {
    singleNumberSegment(exp) {
        return `周${numberToHans(exp)}`;
    }
    spanSegment(exp) {
        const { start, end } = super.parseSpan(exp);
        return `周${numberToHans(start)}到周${numberToHans(end)}`;
    }
    spanSlashNumberSegment(exp) {
        const { start, end, interval } = super.parseSpanSlashNumber(exp);
        return `周${numberToHans(start)}到周${numberToHans(end)}每隔${interval}天`;
    }
    starSegment(exp) {
        return "";
    }
    starSlashNumberSegment(exp) {
        const interval = Number(exp.replace('*/', ''));
        if (interval === 1) {
            return '';
        }
        const days = [];
        for (let wd = 0; wd <= 6; wd += interval) {
            days.push(wd);
        }
        return days.map((d) => `周${numberToHans(d)}`).join(',');
    }
}
exports.WeekPartDescriber = WeekPartDescriber;
